#ifndef RANDOM_FOREST_H
#define RANDOM_FOREST_H



#include "trainingData.h"
#include "tree.h"
#include <map>
#include <memory>

#define RANDOM 0
#define GINI_INDEX 1
#define RANDOMIZED_GINI_INDEX 2

template <typename _T> class RandomForest {

private:
	unsigned int _forestSize;
	bool _enableBagging;

	TrainingData<_T> _trainingData;

	/* Use vector<RandomTree<_T>> instead of auto_ptr beacause auto_ptr 
	does not work with arrays (it calls delete instead of delete [] */

	std::vector<RandomTree<_T>> _randomTrees;

public:
	RandomForest();
	~RandomForest();

	void setEnableBagging(bool enableBaggin);
	bool getEnableBagging();


	void createForest(	std::string trainingDataPath, 
						unsigned int numTrees, 
						unsigned int depth,
						unsigned char algorithm,
						bool enableBagging,
						unsigned int baggingNum);

	unsigned int classify(Record<_T> &record);

};


#endif